<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Node extends Base
{
    use HasFactory;

    protected $deleteTime = 'deleted_at';

    public function setRouteNameAttribute($value)
    {
        $this->attributes['route_name'] = empty($value) ? '' : $value;
    }
    /**
     * 获取所有的节点列表
     * @return void
     */
    public function getNodeAll()
    {
        $data = self::all();
        $result = $this->treeLevel($data);
        return $result;
    }

}
